home *** CD-ROM | disk | FTP | other *** search
/ Enigma Amiga Life 109 / EnigmaAmiga109CD.iso / dalla rivista / host contacted / imengv3.41p2.lha / ImEngV3.41p2 / Extra / SuperView / arexx / SV_Import.rexx < prev   
OS/2 REXX Batch file  |  1997-01-09  |  2KB  |  75 lines

  1. /* 
  2. ** $VER: SV_Import.rexx 1.0, IE Arexx script
  3. ** Image Engineer Macro script
  4. ** Copyright © by Patrik M Nydensten 
  5. ** 9/1 1997 Stockholm/Sweden
  6. **
  7. ** This arexx script will import the currently loaded image in SuperView
  8. ** into Image Engineer. Both programs must be running at the same time.
  9. ** This script was developed to work with SuperView 5.70 and
  10. ** Image Engineer 3.3.
  11. **
  12. */
  13.  
  14. OPTIONS RESULTS
  15. SIGNAL ON ERROR
  16. TEMP_FILE = 't:Image_from_SV'
  17. PORT = 'SuperView.rx'
  18.  
  19. /* Main code */
  20.  
  21. IF ~SHOW('P',PORT) THEN DO
  22.   'REQUEST' '"Could not locate SuperView'x2c(27)'s arexx port!"' '" OK "'
  23.   CALL ErrorOut 0
  24. END
  25.  
  26. ADDRESS VALUE PORT
  27.  
  28. 'SAVE_TYPE=ILBM CmpByteRun1'
  29.  
  30. 'SAVE=' || TEMP_FILE
  31. IF (RC ~= 0) THEN DO
  32.   ADDRESS 'IMAGEENGINEER'
  33.   'IE_TO_FRONT'
  34.      'REQUEST' '"Error when saving image from SuperView!"' '" OK "'
  35.     CALL ErrorOut 10
  36. END
  37.  
  38. ADDRESS 'IMAGEENGINEER'
  39.  
  40. 'OPEN' '"'TEMP_FILE'"' '24'
  41. IF (RC ~= 0) THEN DO
  42.      'REQUEST' '"Error when loading image into IE!"' '" OK "'
  43.     CALL ErrorOut 10
  44. END
  45.  
  46. 'IE_TO_FRONT'
  47.  
  48. CALL ErrorOut 0
  49.  
  50. /* Errorout procedure ----------------------- */
  51.  
  52. ErrorOut:
  53.     PARSE ARG ExitCode
  54.  
  55.     IF (EXISTS( TEMP_FILE )) THEN DO
  56.       ADDRESS COMMAND "Delete >NIL:" TEMP_FILE
  57.   END
  58.   
  59.     EXIT ExitCode
  60.  
  61. /* IE's error procedure --------------------- */
  62.  
  63. Error:
  64. if RC=5 then do
  65.   'IE_TO_FRONT'
  66.   'LAST_ERROR'
  67.   'REQUEST "'||RESULT||'"'
  68. end
  69. else do
  70.   'IE_TO_FRONT'
  71.   'LAST_ERROR'
  72.   'REQUEST "Error detected!!!'||D2C(10)||'Image Engineer error message is as follows'||D2C(10)||result||D2C(10)||'Script failed on line '||SIGL||'"' 'Doh!'
  73. end
  74. CALL ErrorOut 0
  75.